package com.share.bean.oa.org;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * <p>Title：OA-组织机构</p>
 * <p>Description：</p>
 * @Author：杨浩泉
 * @Date：2010-4-27
 */
@Entity
@Table(name="share_oa_organization")
public class Organization {

	/** 单位代码，指单位的组织机构代码，9位数 */
	private String orgCode ;
	
	/** 机构法定人 */
	private String orgLegalPeople ;
	
	/** 机构法定名称 */
	private String orgLegalName ;
	
	/** 机构行政代表电话 */
	private String orgAdminTel ;
	
	/** 机构成立地国 */
	private String establishCountry;
	
	/** 机构成立日期 */
	private Date establishTime;
	
	/** 机构邮编 */
	private String orgZip ;
	
	/** 机构所在地址 */
	private String orgAddr ;
	
	/** 机构简介 */
	private String orgSynopsis ;
	
	/** 机构备注 */
	private String orgBak ;
	
	/** 机构添加时间 */
	private Date addTime ;
	
	private Set<Department> department = new HashSet<Department>();

	@OneToMany(mappedBy="organization")
	@JoinColumn(name="org_code")
	public Set<Department> getDepartment() {
		return department;
	}

	public void setDepartment(Set<Department> department) {
		this.department = department;
	}

	@Temporal(TemporalType.TIMESTAMP)
	public Date getAddTime() {
		return addTime;
	}

	public String getEstablishCountry() {
		return establishCountry;
	}

	@Temporal(TemporalType.DATE)
	public Date getEstablishTime() {
		return establishTime;
	}

	public String getOrgAddr() {
		return orgAddr;
	}

	public String getOrgAdminTel() {
		return orgAdminTel;
	}

	public String getOrgBak() {
		return orgBak;
	}

	@Id @Column(length=9,nullable=false)
	public String getOrgCode() {
		return orgCode;
	}

	@Column(length=200,nullable=false)
	public String getOrgLegalName() {
		return orgLegalName;
	}

	@Column(length=20,nullable=false)
	public String getOrgLegalPeople() {
		return orgLegalPeople;
	}

	public String getOrgZip() {
		return orgZip;
	}
	@Column(length=2000,nullable=false)
	public String getOrgSynopsis() {
		return orgSynopsis;
	}

	public void setOrgSynopsis(String orgSynopsis) {
		this.orgSynopsis = orgSynopsis;
	}
	
	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}

	public void setEstablishCountry(String establishCountry) {
		this.establishCountry = establishCountry;
	}

	public void setEstablishTime(Date establishTime) {
		this.establishTime = establishTime;
	}

	public void setOrgAddr(String orgAddr) {
		this.orgAddr = orgAddr;
	}

	public void setOrgAdminTel(String orgAdminTel) {
		this.orgAdminTel = orgAdminTel;
	}

	public void setOrgBak(String orgBak) {
		this.orgBak = orgBak;
	}

	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}

	public void setOrgLegalName(String orgLegalName) {
		this.orgLegalName = orgLegalName;
	}

	public void setOrgLegalPeople(String orgLegalPeople) {
		this.orgLegalPeople = orgLegalPeople;
	}

	public void setOrgZip(String orgZip) {
		this.orgZip = orgZip;
	}
	
	
}
